<template>
	<view class="content detail" v-html="content.detail"></view>
</template>

<script>
import { getDocDetail } from '../../../api/doc/index.js'
export default {
	data() {
		return {
			content: {}
		}
	},

	computed: {},

	methods: {},

	onLoad(option) {
		// #ifdef MP-WEIXIN
		wx.showShareMenu({
			withShareTicket: true,
			menus: ['shareAppMessage', 'shareTimeline']
		})
		// #endif

		getDocDetail(option.id).then((data) => {
			this.content = data
			this.content.detail = this.content.detail.replace(
				/\<img/gi,
				'<img style="max-width:100%;height:auto"'
			)
			uni.setNavigationBarTitle({
				title: this.content.title
			})
		})
	}
}
</script>
<style lang="scss">
/* #ifdef MP-WEIXIN */
[alt] {
	max-width: 100%;
}
/* #endif */
</style>
